package com.ScoresSystem.service.Impl;

import com.ScoresSystem.mapper.SubjectMapper;
import com.ScoresSystem.pojo.Student;
import com.ScoresSystem.pojo.Subject;
import com.ScoresSystem.service.SubjectService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;
@Service
public class SubjectServiceImpl implements SubjectService {

    @Autowired
    SubjectMapper subjectMapper;

    @Override
    public List<Subject> getAllSubject(String name, int pageIndex, int pageSize) {
        return subjectMapper.getAllSubject(name, pageIndex, pageSize);
    }

    @Override
    public int getCount(String subjectName) {
        return subjectMapper.getCount(subjectName);
    }

    @Override
    public Subject findSubjectByName(String subjectName) {
        return subjectMapper.findSubjectByName(subjectName);
    }

    @Override
    public int addSubject(Subject subject) {
        return subjectMapper.addSubject(subject);
    }

    @Override
    public int updateSubject(Subject subject) {
        return subjectMapper.updateSubject(subject);
    }

    @Override
    public int deleteSubject(String id) {
        return subjectMapper.deleteSubject(id);
    }

    @Override
    public List<Subject> subjectSelect() {
        return subjectMapper.subjectSelect();
    }
}
